﻿using System.Collections.Generic;
using System.Text;

namespace SpeadFrm.Web.Mvc.ValidationEngine
{
    public class JqValidate
    {
        private readonly StringBuilder _validateCssClassStrings = new StringBuilder();

        public JqValidate Reqired()
        {
            _validateCssClassStrings.Append("required,");
            return this;
        }

        public JqValidate Email()
        {
            _validateCssClassStrings.Append("custom[email],");
            return this;
        }

        public JqValidate Url()
        {
            _validateCssClassStrings.Append("custom[url],");
            return this;
        }

        public JqValidate Compare(string equalHtmlId)
        {
            _validateCssClassStrings.AppendFormat("equals[{0}],", equalHtmlId);
            return this;
        }

        public JqValidate FuncCall(string funcName)
        {
            _validateCssClassStrings.AppendFormat("funcCall[{0}],", funcName);
            return this;
        }

        public JqValidate MinSize(int num)
        {
            _validateCssClassStrings.AppendFormat("minSize[{0}],", num);
            return this;
        }

        public JqValidate MaxSize(int num)
        {
            _validateCssClassStrings.AppendFormat("maxSize[{0}],", num);
            return this;
        }

        public JqValidate Integer()
        {
            _validateCssClassStrings.Append("custom[integer]");
            return this;
        }



    }


}